ISSAC 2002 Project Description

Lorenz Grapher
Team, Pike High School

Jared Witte
6715 Thoroughbred Drive
Indianapolis, IN 46278
(317) 876-3807
jw8soccer@hotmail.com

Mr. Ren	H: (317) 913-9288
		W: (317) 387-4601
		gpren2001@yahoo.com
Caleb Fulton	axvxia@yahoo.com
Alex Kubacki	usernotfound@yahoo.com
Jared Witte	jw8soccer@hotmail.com
Aaron Wynne	Chafro_American@yahoo.com

Project Description

This program demonstrates the implementation of three-space equation graphing in Visual Basic.  It graphs and allows the user to rotate the Lorenz attractor and the torus knot equations.  It includes information on each of these graphs as well as an easy-to-use interface with a starfield simulation added on the “about” screen.  The user can input values other than that of the default as well as change the number of points rendered by the program for each of these equations, as well.

High Level Design Overview of the Software Project

The interface uses standard Visual Basic objects such as buttons, slider boxes, and textboxes as well as a small menu system, allowing the user to input any change in settings or preferences.  The three-space graphing works as follows:

The program’s “mouse button down” procedure calls for the creation of the raw 3-dimensional points if the graph needs updating (this variable is set in various interface procedures).
|
\/
The program then calculates the raw data for one of the graphs, depending on which one is selected in the menu.
|
\/
The raw 3-dimensional coordinates for the selected graph are calculated and stored in an array.  A counter defines the point in the 3-dimensional array of points which is to be calculated, from 0 to the maximum number of points. 
|
\/
From here, the program sends these coordinates to the rotation procedure, which uses three well-known rotation equations to assign new x, y, and z values to each of the points based upon a given angle of rotation for each axis.  These angles default to zero, but if the mouse button is being held down, the change in the mouse coordinates from where the button was first clicked is proportional to the change in the x, y, and z angles and also dictates, based upon horizontal and vertical changes in coordinates, which axis the graph is to be rotated about.  The rotation formulas are applied, via a loop, to each coordinate in the graph and are the same for both graphs.
|
\/
The program then performs the transform procedure, where the three dimensional coordinates are transformed into a new array of two dimensional coordinates.  This is done using a loop just like the loop in the above two steps.
|
\/
Following the three unseen procedures, the program then draws the graph.  The draw procedure simply connects the dots from 0 to the end, using the z-coordinate of the first coordinate on the line to dictate the color.  This is done with a loop, just like the rest.
|
\/
After the drawing is complete, the program simply waits for one of several messages including:

-Movement in the mouse if the button is held down, which then calls for the program to go back through the rotate, transform, and draw procedures and wait for more input.
-The release of the button if it is being held down, which simply changes the state of the mouse button variable and causes the program to wait for more input. 
-The pressing of the button if it is not being held down, which redraws the graph and changes the state of the mouse button variable so that it awaits movement or the release of the button.
-A change in any of the graph selections, which re-calculates the new graph, rotates it by 0 degrees, transforms it, and then draws it.  The program then waits for more input.
-A change in any of the user-assigned values for the graph, which will cause the graph to be recalculated and drawn when the mouse button is clicked again.  The program waits after this.
-A change in the state of the window (redrawing/resizing) will cause the graph to be redrawn when the mouse button is clicked again.  Again, the program will wait for messages after doing this.
|
\/
Following any of these, the program simply waits for any more messages and reacts accordingly.

The “about” dialogue that pops up when the appropriate menu item is clicked has a simple starfield simulation in the background.  This is a separate procedure which randomizes an array of 3d coordinates and goes through a loop which draws the transformed 3d coordinates onto the screen, subtracts a given amount of units from the z-axis coordinate of each star, and then starts the loop over again.  Within this loop, there is a conditional procedure which will recalculate single stars when their z-coordinate exceeds a certain point (equivalent to the “windshield” of the “spaceship”) and continue the loop.  

Program Development Specifics

Programmed in Visual Basic 6.0 on a Windows 98 machine.

Platforms

This program is compatible with Windows 95, 98, ME, 2000, and NT.  It has not yet been tested on Windows XP, but the backwards compatibility of this operating system, coupled with the fact that it uses the same kernel as Windows 2000, leaves one to believe that it would work.

Details for loading/running your Software
	
Run the executable Lorenz.vbp
Click on the run/start button in Visual Basic

Acknowledgements

We acknowledge the help of Visual Basic built-in references and of Mr. Ren (our programming teacher).

Statement of Ethics

The program Lorenz Grapher and its instructions were completed by the individuals sited above, and no illegal software was used.

References

With the exception of the built-in references in Visual Basic and the formulas for the Lorenz attractor and the torus knot (found on http://astronomy.swin.edu.au/~pbourke/curves/knot/ and http://astronomy.swin.edu.au/~pbourke/fractals/lorenz/ ), all equations for transformation or rotation were derived using prior knowledge of trigonometry, algebra, and calculus.